home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Examples / Sound / Include / SndPart.h next >
Encoding:
Text File  |  1994-04-21  |  3.9 KB  |  137 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SndPart.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Author:                Lonnie Millett
  7. //    Creation Date:        3/28/94
  8. //
  9. //    Copyright:    © 1993, 1994 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef SNDPART_H
  14. #define SNDPART_H
  15.  
  16. #ifndef SNDPARTDEF_H
  17. #include "SndPartDef.h"
  18. #endif
  19.  
  20. // ----- Framework Includes -----
  21.  
  22. #ifndef FWCTLMGR_H
  23. #include "FWCtlMgr.h"
  24. #endif
  25.  
  26. #ifndef FWSELECT_H
  27. #include "FWSelect.h"
  28. #endif
  29.  
  30. //==============================================================================
  31. //    •• class CSndPart
  32. //==============================================================================
  33.  
  34. class CSndPart : public FW_CCtlMgrPart
  35. {
  36. //------------------------------------------------------------------------------
  37. //    • Initialization/Destruction
  38. //
  39. public:
  40.     CSndPart();
  41.     virtual CDECL ~CSndPart();
  42.     
  43. //------------------------------------------------------------------------------
  44. //    • Inherited API
  45. //
  46. public:
  47.     virtual XMPValueType        GetContentPropertyValueType() const;
  48.  
  49.     virtual FW_CFrame*                NewFrame(XMPFrame* xmpFrame, XMPTypeToken presentation);
  50.     virtual FW_CSelection*        NewSelection();
  51.     
  52.     virtual void                 InternalizeContent(XMPStorageUnit* storageUnit);
  53.     virtual void                 ExternalizeContent(XMPStorageUnit* storageUnit);
  54.     
  55.     virtual void                 DoClick(const FW_CPoint& where, XMPEventData event);
  56.     
  57.     FW_PlatformHandle                        GetSoundHandle() const;
  58.     void                        SetSoundHandle(FW_PlatformHandle soundHandle);
  59.     
  60. protected:
  61.     virtual ControlHandle        CreateControlHandle(XMPPlatformWindow window, 
  62.                                                     const FW_CRect& controlRect);
  63.     
  64.  
  65. private:
  66.     FW_PlatformHandle fSoundHandle;
  67.                                     
  68. };
  69.  
  70. //----------------------------------------------------------------------------------------
  71. // CSndPart::GetSoundHandle
  72. //----------------------------------------------------------------------------------------
  73. inline FW_PlatformHandle CSndPart::GetSoundHandle() const
  74. {
  75.     return fSoundHandle;
  76. }
  77.  
  78. //==============================================================================
  79. //    •• class CSndFrame
  80. //==============================================================================
  81.  
  82. #define kCSndFrameID "appl:CSndframe$class,1.0.0"
  83.  
  84. class CSndFrame : public FW_CCtlMgrFrame
  85. {
  86. //------------------------------------------------------------------------------
  87. //    • Initialization/Destruction
  88. //
  89. public:
  90.     CSndFrame();
  91.     virtual void InitSndFrame(XMPFrame* frame, FW_CPart* part);    
  92.     virtual CDECL ~CSndFrame();
  93.  
  94. //------------------------------------------------------------------------------
  95. //    • Inherited API
  96. //
  97. public:
  98.     virtual void            UpdateUsedShape();
  99.  
  100. };
  101.  
  102. //==============================================================================
  103. //    •• class CSndSelection
  104. //==============================================================================
  105.  
  106. class CSndSelection : public FW_CSelection
  107. {
  108.     
  109. //------------------------------------------------------------------------------
  110. //    • Initialization/Destruction
  111. //------------------------------------------------------------------------------
  112. public:
  113.                     CSndSelection();
  114.     void            InitSndSelection(CSndPart* sndPart);
  115.     virtual         ~CSndSelection();
  116.     
  117. //------------------------------------------------------------------------------
  118. //    • Inherited API
  119. //------------------------------------------------------------------------------
  120. public:
  121.     virtual void        CloseSelection();
  122.     virtual void        SelectAll();
  123.     virtual FW_Boolean    IsEmpty() const;
  124.     virtual FW_Boolean    DoClear();
  125.     
  126.     virtual void        ExternalizeSelection(XMPStorageUnit* storageUnit, FW_CFrame* commandFrame, XMPCloneKind cloneKind);
  127.     virtual FW_Boolean    InternalizeSelection(XMPStorageUnit* storageUnit, XMPCloneKind cloneKind);
  128.  
  129. //------------------------------------------------------------------------------
  130. //    • Data Members
  131. //------------------------------------------------------------------------------
  132. private:
  133.     CSndPart*            fSndPart;
  134. };
  135.  
  136. #endif
  137.